from redis import StrictRedis

class Config:
    DEBUG = True

    # 设置密钥
    SECRET_KEY = 'skdjbfassaassABAs'

    # mysql数据库的配置链接信息
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info13'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    #定义redis链接的配置信息
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    # 配置状态保持打session信息储存的位置redis
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(REDIS_HOST, REDIS_PORT)
    SESSION_UES_SIGNER = True
    PERMANENT_SESSION_LIFETIME = 86400


# 开发模式下的配置
class DevelopmentConfig(Config):
    DEBUG = True

# 生产环境下的配置
class ProductionConfig(Config):
    DEBUG = False

# 定义字典，实现配置对象的映射
config_dict = {
    'development':DevelopmentConfig,
    'production':ProductionConfig,

}
